<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<xsl:include href='../xsl.include.main.xsl'/>

<xsl:template match="*|/"><xsl:apply-templates/></xsl:template>

<xsl:template match="text()|@*"><xsl:value-of select="."/></xsl:template>

<xsl:template match='nbsp' name='nbsp'>
<xsl:text disable-output-escaping='yes'>&amp;nbsp;</xsl:text>
</xsl:template>

<xsl:template match="blog">


<xsl:apply-templates/>


<xsl:if test="@errorString!=''">
	<script> alert("<xsl:value-of select="@errorString"/>");</script>
</xsl:if>

</xsl:template>


<xsl:template match="segment[@public=1]">

<xsl:if test="/blog/@enableEdit = 1">
<div style="
  margin-left:5px 5px 0;
  margin-right:5px 5px 0;
  padding-left:80px;
  padding-right:20px;
  padding-top:5px;
  padding-bottom:5px;
  color:#999;
  text-align:right;
">
sei l'autore puoi&#160;<a style="text-decoration:underline;" href="/userinfo/blog.segment.aspx?blogid={@blogid}&amp;edit=1">modificare</a>&#160;o&#160;<a style="text-decoration:underline;" href="/userinfo/blog.aspx?blogid={@blogid}&amp;delete=1">eliminare</a>
</div>
</xsl:if>

<div class="bleachBox" style="
  margin-top:0px;
  margin-left:0px;
  margin-right:0px;
  padding-top:5px;
  padding-bottom:0px;
  font:100%/1.4em 'Trebuchet MS',Trebuchet,Arial,Verdana,Sans-serif;
  text-transform:uppercase;
  letter-spacing:.2em;
  color:#999;
">
<span class="blogDate">
<xsl:call-template name="weekDayLongIta">
	<xsl:with-param name="dw" select="@dw"/>
</xsl:call-template>,&#160;<xsl:value-of select="substring(@date,9,2)"/>
&#160;<xsl:call-template name="monthNameIta">
	<xsl:with-param name="month" select="substring(@date,6,2)"/>
</xsl:call-template>
&#160;<xsl:value-of select="substring(@date,1,4)"/>,&#160;<xsl:value-of select="substring(@date,12,8)"/>
</span>
</div>

<div class="bleachBox" style="
  margin-top:0px;
  margin-left:0px;
  margin-right:0px;
  padding-top:5px;
  padding-bottom:0px;
  line-height:1.2em;
  font-weight:normal;
  color:#c60;
  text-transform:uppercase;
  letter-spacing:.2em;
">
<span class="blogTitle"><xsl:value-of select="@title"/></span>
</div>

<div class="bleachBox" style="
  margin-top:0px;
  margin-left:0px;
  margin-right:0px;
  padding-top:0px;
  padding-bottom:10px;
  font:100%/1.4em 'Trebuchet MS',Trebuchet,Arial,Verdana,Sans-serif;
  text-transform:lowercase;
  letter-spacing:.2em;
">
<xsl:for-each select="keywords">
<a class="blogDate" href="/forums/lastUsed.aspx?keyid={@keyid}&amp;blog=1" style="color:#999;"><xsl:value-of select="@keyword"/>,</a>&#032;
</xsl:for-each>
</div>

<div class="bleachBox" style="
  margin-bottom:0px;
  margin-left:0px;
  margin-right:0px;
  padding-top:5px;
  padding-bottom:10px;
  color:#333;
  font-size: 11pt;">
  <span class="blogBody"><xsl:value-of select="@body" disable-output-escaping='yes'/></span>
</div>


<table border="0" width="100%">
<tr>
<td width="50%">
	<xsl:choose>
	<xsl:when test='/blog/@userid = /blog/@viewerid'>
				<ul class='star-ratingd'>
					<li class='current-rating' style='width:{(@vt div @wt)*25}px;' id="current-rating{position()}">Currently 3.5/5 Stars.</li>
					<li><a onclick="" href='javascript:void(null);' title='1 star out of 5' class='one-star'>1</a></li>
					<li><a onclick="" href='javascript:void(null);' title='2 stars out of 5' class='two-stars'>2</a></li>
					<li><a onclick="" href='javascript:void(null);' title='3 stars out of 5' class='three-stars'>3</a></li>
					<li><a onclick="" href='javascript:void(null);' title='4 stars out of 5' class='four-stars'>4</a></li>
					<li><a onclick="" href='javascript:void(null);' title='5 stars out of 5' class='five-stars'>5</a></li>
				</ul>
	</xsl:when>
	<xsl:otherwise>
				<ul class='star-rating'>
					<li class='current-rating' style='width:{(@vt div @wt)*25}px;' id="current-rating{position()}">Currently 3.5/5 Stars.</li>
					<li><a onclick="javascript:ratethis(this.parentNode, '1', '{@blogid}', {position()}); return false;" href='javascript:void(null);' title='1 star out of 5' class='one-star'>1</a></li>
					<li><a onclick="javascript:ratethis(this.parentNode, '2', '{@blogid}', {position()}); return false;" href='javascript:void(null);' title='2 stars out of 5' class='two-stars'>2</a></li>
					<li><a onclick="javascript:ratethis(this.parentNode, '3', '{@blogid}', {position()}); return false;" href='javascript:void(null);' title='3 stars out of 5' class='three-stars'>3</a></li>
					<li><a onclick="javascript:ratethis(this.parentNode, '4', '{@blogid}', {position()}); return false;" href='javascript:void(null);' title='4 stars out of 5' class='four-stars'>4</a></li>
					<li><a onclick="javascript:ratethis(this.parentNode, '5', '{@blogid}', {position()}); return false;" href='javascript:void(null);' title='5 stars out of 5' class='five-stars'>5</a></li>
				</ul>
	</xsl:otherwise>
	</xsl:choose>
			<div id="ratingcaption{position()}" class="b10b" style="color:lightgrey">
		<xsl:choose>
			<xsl:when test='@vt &gt; 0'>
				punteggio: <xsl:value-of select="format-number( @vt div @wt, '0.##')"/>
			</xsl:when>
			<xsl:otherwise>
				nessun voto
			</xsl:otherwise>
		</xsl:choose>
		<xsl:choose>
			<xsl:when test='/blog/@userid = /blog/@viewerid'>
				, <span style="color:grey;">non puoi autovotarti!</span>
			</xsl:when>
			<xsl:when test='@yourrating'>
				, il tuo voto <xsl:value-of select="@yourrating"/>
			</xsl:when>
			<xsl:when test='@vt &gt; 0'>
				, <span style="color:grey;">non hai ancora votato</span>
			</xsl:when>
			<xsl:otherwise>
			</xsl:otherwise>
		</xsl:choose>
	</div>
</td>
<td>
<div style="
	margin-top:5px;
	padding-top:5px;
	font-size: 8pt;
	text-align:right;
">
<xsl:variable name="blogid" select="@blogid"/>

 <xsl:choose>
   <xsl:when test="/blog/comment[@blogid=$blogid]/@comments = 1">
		<span style="padding-left:5px;width:50%;"><a href="/userinfo/blog.aspx?blogid={@blogid}&amp;userid={/blog/@userid}"><xsl:value-of select="/blog/comment[@blogid=$blogid]/@comments"/> COMMENTO,&#160;</a></span>
   </xsl:when>
   <xsl:when test="/blog/comment[@blogid=$blogid]/@comments &gt; 0">
		<span style="padding-left:5px;width:50%;"><a href="/userinfo/blog.aspx?blogid={@blogid}&amp;userid={/blog/@userid}"><xsl:value-of select="/blog/comment[@blogid=$blogid]/@comments"/> COMMENTI,&#160;</a></span>
   </xsl:when>
   <xsl:otherwise>
		<span style="padding-left:5px;width:50%;">0 COMMENTI,&#160;</span>
   </xsl:otherwise>
 </xsl:choose>
 <xsl:choose>
   <xsl:when test="/blog/@isbaddie = 1">
		<span style="text-align:right;padding-right:0px;width:45%;">Niente rompiscatole!</span>
   </xsl:when>
   <xsl:otherwise>
	<span style="background:url(/imgs/pencil.gif) left center no-repeat;padding:4px 0px 4px 25px;"><a href="/userinfo/blogComment.aspx?blogid={@blogid}&amp;comment=1&amp;userid={/blog/@userid}">scrivi commento</a></span>
   </xsl:otherwise>
 </xsl:choose>
</div>
</td>
</tr>
</table>    

<div style="padding-bottom:10px;"></div>

<xsl:if test="/blog/comment/comments">
	<div class="blogBody" style="
	background:#fff;
	margin-bottom:5px;
	margin-top:5px;
	margin-left:0px;
	margin-right:0px;
	padding-top:5px;
	color:#333;
	font-size: 10pt;">
<xsl:for-each select="/blog/comment/comments">
<div style="width:100%;
	margin-top:5px;
">
		<nobr>
		<xsl:call-template name="user">
			<xsl:with-param name="status" select="@uStatus"/>
			<xsl:with-param name="sexid" select="@sexid"/>
			<xsl:with-param name="certified" select="@certified"/>
			<xsl:with-param name="userid" select="@userid"/>
			<xsl:with-param name="nick" select="@nick"/>
			<xsl:with-param name="bold" select="0"/>
			<xsl:with-param name="buddy" select="0"/>
			<xsl:with-param name="newbie" select="0"/>
		</xsl:call-template>
		</nobr>
	<div>
		<xsl:value-of select="@comment"/>
	</div>
	<div style="width:100%;text-align:right;
		padding-right:5px;
		margin-top:0px;
		margin-bottom:20px;
		border-bottom:1px solid #eee;
		font-size: 8pt;
	">
	<xsl:value-of select="substring(@date,9,2)"/>-<xsl:value-of select="substring(@date,6,2)"/>-<xsl:value-of select="substring(@date,1,4)"/>,&#160;<xsl:value-of select="substring(@date,12,8)"/>
<xsl:if test="/blog/@enableEdit = 1">
	<br/><a href="/userinfo/blog.aspx?blogid={@blogid}&amp;deleteComment={@msgid}">Cancella commento</a>
</xsl:if>
	</div>

	</div>
</xsl:for-each>
	</div>
</xsl:if>

</xsl:template>

</xsl:stylesheet>